package org.scratchcrew.services.security;

/**
 * Simple class that associates a SecurityContext instance with the current
 * thread.
 */
public abstract class SecurityContextHolder {
	private static final ThreadLocal<SecurityContext> currentContext = new ThreadLocal<SecurityContext>();

	public static SecurityContext getCurrentContext() {
		return currentContext.get();
	}

	public static void setSecurityContext(SecurityContext securityContext) {
		currentContext.set(securityContext);
	}

	public static void cleanUpSecurityContext() {
		currentContext.set(null);
	}

}
